package org.andao.commons.service;

import java.util.List;

import org.andao.commons.model.Attachs;
import org.andao.core.base.service.BaseService;
import org.andao.core.exception.ServiceException;




/**
 * 公共附件服务接口. 
 * 
 * @author Marco.hu(hzg139@163.com)
 */
public interface AttachsService extends BaseService<Attachs>{

	/**
	 * 根据表单ID更新附件
	 * @param attachId
	 * @param formId
	 * @param formType
	 * @throws ServiceException
	 */
	void updateAttachByFormId(String[] attachIds,String formId,String formType,String fillinManId,String fillinMan) throws ServiceException;
	
	/**
	 * 处理文件同时保存实体.
	 * @param attach
	 * @param object
	 * @return
	 */
	Object saveOrUpdateWithEntity(Attachs attach,Object object);
	
	/**
	 * 根据表单ID获取附件列表
	 * @param formId
	 * @return
	 * @throws ServiceException
	 */
	List<Attachs> findAttachsByFormId(String formId) throws ServiceException;
	
	/**
	 * 删除附件.
	 * @param attachId
	 * @throws ServiceException
	 */
	void deleteAttach(String attachId) throws ServiceException;
	
	/**
	 * 根据fillinmanid获取附件列表
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	List<Attachs> findAttachsByFillInManIdAndTypes(String id,String[] types) throws ServiceException;
}
